/*
 * Copyright 2009 Gary Brown
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 *
 * Change History:
 * 7 Mar 2009 : Initial version created by gary
 */
package org.betonthemove.platform.betfair;

import org.betonthemove.platform.*;

public class BetfairMarketEntrant implements MarketEntrant {

	public BetfairMarketEntrant() {
	}
	
	public String getName() {
		return(m_name);
	}
	
	public void setName(String name) {
		m_name = name;
	}
	
	public int getSelectionId() {
		return(m_selectionId);
	}
	
	public void setSelectionId(int sid) {
		m_selectionId = sid;
	}
	
	public long getTimestamp() {
		return(m_timestamp);
	}
	
	public void setTimestamp(long ts) {
		m_timestamp = ts;
	}
	
	public double getLastPriceMatched() {
		return(m_lastPriceMatched);
	}
	
	public void setLastPriceMatched(double d) {
		m_lastPriceMatched = d;
	}
	
	public double getTotalMatched() {
		return(m_totalMatched);
	}
	
	public void setTotalMatched(double d) {
		m_totalMatched = d;
	}
	
	public void setCurrentBackOdds(double d) {
		m_currentBackOdds = d;
	}
	
	public double getCurrentBackOdds() {
		return(m_currentBackOdds);
	}
	
	public void setCurrentBackPrice(double d) {
		m_currentBackPrice = d;
	}
	
	public double getCurrentBackPrice() {
		return(m_currentBackPrice);
	}
	
	public void setCurrentLayOdds(double d) {
		m_currentLayOdds = d;
	}
	
	public double getCurrentLayOdds() {
		return(m_currentLayOdds);
	}
	
	public void setCurrentLayPrice(double d) {
		m_currentLayPrice = d;
	}
	
	public double getCurrentLayPrice() {
		return(m_currentLayPrice);
	}
	
	public void setOrderIndex(int index) {
		m_orderIndex = index;
	}
	
	public int getOrderIndex() {
		return(m_orderIndex);
	}
	
	public String toString() {
		return("Name="+getName()+" Id="+getSelectionId()+
				"Current Back="+getCurrentBackOdds()+" Lay="+
				getCurrentLayOdds()+" LastMatched="+getLastPriceMatched());
	}
	
	public int hashCode() {
		return(m_selectionId);
	}
	
	public boolean equals(Object obj) {
		boolean ret=false;
		
		ret = (obj instanceof BetfairMarketEntrant &&
				m_selectionId == ((BetfairMarketEntrant)obj).getSelectionId());
		
		return(ret);
	}
	
	private String m_name=null;
	private int m_selectionId=0;
	private long m_timestamp=0;
	private double m_lastPriceMatched=0.0;
	private double m_totalMatched=0.0;
	private double m_currentBackOdds=0.0;
	private double m_currentBackPrice=0.0;
	private double m_currentLayOdds=0.0;
	private double m_currentLayPrice=0.0;
	private int m_orderIndex=0;
}
